package sz.szsmk.citizencard.ui.fragment;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnRefreshListener;

import sz.szsmk.citizencard.DaggerApplication;
import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.databinding.FragmentCouponTouseBinding;
import sz.szsmk.citizencard.ioc.Compontent.DaggerCommonFragmentComponent;
import sz.szsmk.citizencard.model.network.bean.response.QueryNearStandbyRes;
import sz.szsmk.citizencard.mvp.contract.ICouponToUseContact;
import sz.szsmk.citizencard.mvp.presenter.CouponToUsePresenter;
import sz.szsmk.citizencard.ui.base.IBaseFragment;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/11/15 20:27
 * description:
 */
public class CouponToUseFragment extends IBaseFragment <CouponToUsePresenter, FragmentCouponTouseBinding>
implements ICouponToUseContact.ICouponToUseView{


//    private RecyclerView collecSiteRv;
//    private BusSiteNearbyAdapter busSiteNearbyAdapter;

    public static CouponToUseFragment getInstance() {
        CouponToUseFragment sf = new CouponToUseFragment();
        return sf;
    }


    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_coupon_touse;
    }

    @Override
    protected void initInjector() {

        DaggerCommonFragmentComponent.builder().appCompontent(DaggerApplication.getAppComponent())
                .build().inject(this);
    }

    @Override
    protected void initViews() {
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());

//        dataBinding.couponToUseRl.setLayoutManager(new LinearLayoutManager(getContext()));
//        dataBinding.swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
//            @Override
//            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
//                mPresenter.getDataList("string","string");
//            }
//        });
    }

    @Override
    protected void updateViews() {

    }

    @Override
    public void getDataListSucc(QueryNearStandbyRes response) {
//        busSiteNearbyAdapter.setViewData(response.getBusSiteList());
//        busSiteNearbyAdapter.notifyDataSetChanged();
//        dataBinding.collecSiteRv.onFinishRequest(false, false);
    }

    @Override
    public void getDataListFail() {

//        dataBinding.collecSiteRv.onFinishRequest(false, false);
    }


    @Override
    public void onResume() {
        super.onResume();
//        mPresenter.getDataList("string","string");
//        dataBinding.collecSiteRv.startLoadFirst();
    }
}
